package com.example.testhilt.module

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent

/**
 ********************************************************
 *Author: chinadragon
 *Time: 2020/11/24 11:24 AM
 *Name:
 *Overview:
 *
 *  1、接口的依赖注入
 *
 *  2、给相同类型注入不同的实例
 *
 *Usage:
 ********************************************************
 */

@Module
@InstallIn(ActivityComponent::class)
abstract class EngineModule {

    @BindGasEngine
    @Binds
    abstract fun bindGasEngine(gasEngine: GasEngine): Engine

    @BindElectricEngine
    @Binds
    abstract fun binElectricEngine(electricEngine: ElectricEngine): Engine
}